<template>
  <div v-if="secondLayerData.length" :id="`menuScroll${scrollFirstIndex}-${scrollSecondIndex}`"
    class="salary-container cardWrapper">
    <div class="total-salary">
      <div class="salary-title">
        <img class="item-img" src="https://img3.job1001.com/data_center/images/position_item_icon.png" alt="404" />
        <span class="item-title">职业价值</span>
      </div>

      <div class="chartContainer">
        <div :class="['region-salary',item.layerId==20||item.hasExtendContent?'bigger':'']"
          :id="`scroll${scrollSecondIndex}-${index}`" v-for="item,index in secondLayerData" :key="item.layerId">
          <!-- radarChartVue和工作风险那边的组件不一样哦 -->
          <radarChartBigger :layerData.sync="item" :layerId="item.layerId" v-if="item.layerId==20" :isAdmin="isAdmin"
            :isSuperToken="isSuperToken" />
          <radarChartVue :layerData.sync="item" :layerId="item.layerId" v-else :isAdmin="isAdmin"
            :isSuperToken="isSuperToken" />
        </div>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  props: {
    secondLayerData: {
      type: Array,
      default: () => [],
    },
    scrollFirstIndex: {
      type: [String, Number],
      default: 0,
    },
    scrollSecondIndex: {
      type: [String, Number],
      default: 0,
    },
    topId: {
      type: String,
      required: true,
    },
    isSuperToken: {
      type: Boolean,
      default: false,
    },
    isAdmin: {
      type: Boolean,
      default: false,
    },
  },
  watch: {
    secondLayerData: {
      handler(newValue, oldValue) {
        // //console.log("enterpriseRecruitmentNeeds secondLayerData", newValue);
      },
      immediate: true,
    },
  },
  name: "careerValue",
  components: {
    radarChartVue: () => import("../../components/radarChart.vue"),
    radarChartBigger: () => import("../../components/radarChartBigger.vue"),
  },
};
</script>

<style scoped lang="scss">
.cardWrapper {
  margin-bottom: 14px;
}
.list {
  /* height: 630px;
    overflow-y: auto; */
}
.salary-container {
  position: relative;
  min-width: 800px;
  padding-top: 0px;
  padding-right: 0px;

  overflow: scroll;
  &::-webkit-scrollbar {
    width: 4px;
    background-color: #fff;
    border-radius: 4px;

    height: 4px;
  }
  &::-webkit-scrollbar-thumb {
    background-color: #d8d8d8;
    border-radius: 4px;
  }
}
.total-salary {
  // background: linear-gradient(0, #eaf5ff 0%, #ffffff 100%);
  background-size: 100% 219px;
  background-repeat: no-repeat;
  background-image: url("https://img3.job1001.com/data_center/images/salary_bg.png?v=1");
  // background: #ffffff;
  border-radius: 10px;
  border: 1px solid #cbdcfe;
  padding: 20px 20px 11px;
}
.cate-salary {
  // background: linear-gradient(0, #eaf5ff 0%, #ffffff 100%);
  background-size: 100% 293px;
  background-repeat: no-repeat;
  background-image: url("https://img3.job1001.com/data_center/images/salary_bg.png?v=1");
  // background: #ffffff;
  border-radius: 10px;
  border: 1px solid #cbdcfe;
  margin-top: 14px;
  padding: 20px;
}
.salary-title {
  display: flex;
  align-items: center;
  .item-img {
    width: 39px;
    height: 40px;
    align-self: center;
  }
  .item-title {
    margin-left: 10px;
    color: #000;
    font-size: 22px;
    font-weight: bold;
    font-family: PingFang SC;
  }
}
.chartContainer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  margin-top: 20px;
  .region-salary {
    min-width: calc(50% - 6px);
    &.bigger {
      width: 100%;
      ::v-deep.secondItem {
        width: 100%;
        justify-content: space-between;
      }
    }
  }
}

.isShitBrowser {
  background-position: 0px 0px;
}
</style>
  